import request from '@/utils/request'

export function getDepartment() {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}

// 添加部门
// {code, introduce,manager,name,pid:父级部门的id}
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

// 获取部门的详情数据
export function getDepartDetail(id) {
  return request({
    url: '/company/department/' + id, // 部门编号,
    method: 'GET'
  })
}

// 编辑部门
// {code, introduce,manager,name,pid:父级部门的id}
export function editDepartment(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'PUT',
    data
  })
}

// 删除部门的详情数据
export function delDepart(id) {
  return request({
    url: '/company/department/' + id, // 部门编号,
    method: 'DELETE'
  })
}

